/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path);
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ["admin", "editor"];
  return valid_map.indexOf(str.trim()) >= 0;
}

//校验的方法
export function handleValidateMobile(mobile) {
  console.log(mobile + "ww");
  const reg = /^1[3-9]\d{9}$/;
  //若校验通过，返回true,反之返回false
  return reg.test(mobile);
}
